home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / games / nhak_src.zip / HACK.H < prev    next >
C/C++ Source or Header  |  1993-03-16  |  4KB  |  158 lines

  1. /*    SCCS Id: @(#)hack.h    3.0    88/07/19
  2. /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  3. /* NetHack may be freely redistributed.  See license for details. */
  4.  
  5. #ifndef HACK_H
  6. #define HACK_H
  7.  
  8. #ifndef CONFIG_H
  9. #include "config.h"
  10. #endif
  11.  
  12. #define    TELL        1
  13. #define NOTELL        0
  14. #define ON         1
  15. #define OFF         0
  16. #define    BOLT_LIM    8    /* from this distance ranged attacks will be made */
  17. #ifdef HARD
  18. #define    MAX_CARR_CAP    120    /* so that boulders can be heavier */
  19. #else
  20. #define    MAX_CARR_CAP    500
  21. #endif
  22. #define    FAR    (COLNO+2)    /* position outside screen */
  23. #ifdef NULL
  24. #undef NULL
  25. #endif /* NULL */
  26. #define NULL  ((genericptr_t)0)
  27. #define DUMMY { 0 }
  28.  
  29. /* this is the way the game ends */
  30. /* if these are rearranged, the arrays in end.c will need to be changed */
  31. #define DIED        0
  32. #define CHOKING     1
  33. #define POISONING    2
  34. #define STARVING    3
  35. #define DROWNING    4
  36. #define BURNING     5
  37. #define CRUSHING    6
  38. #define STONING     7
  39. #define GENOCIDED    8
  40. #define PANICKED    9
  41. #define TRICKED     10
  42. #define QUIT        11
  43. #define ESCAPED     12
  44. #ifdef ENDGAME
  45. #define ASCENDED    13
  46. #endif
  47.  
  48. #ifndef DECL_H
  49. #include "decl.h"
  50. #endif
  51.  
  52. #ifndef MONSYM_H
  53. #include     "monsym.h"
  54. #endif
  55. #ifndef MKROOM_H
  56. #include    "mkroom.h"
  57. #endif
  58. #ifndef OBJCLASS_H
  59. #include    "objclass.h"
  60. #endif
  61.  
  62. extern coord bhitpos;    /* place where thrown weapon falls to the ground */
  63.  
  64. #ifndef GOLD_H
  65. #include    "gold.h"
  66. #endif
  67. #ifndef TRAP_H
  68. #include    "trap.h"
  69. #endif
  70. #ifndef FLAG_H
  71. #include    "flag.h"
  72. #endif
  73.  
  74. #ifndef RM_H
  75. #include    "rm.h"
  76. #endif
  77.  
  78. #ifdef OVERLAY    /* This doesn't belong here, but we have little choice */
  79. #undef NDECL
  80. #define NDECL(f) f()
  81. #endif
  82.  
  83. #ifndef EXTERN_H
  84. #include    "extern.h"
  85. #endif
  86.  
  87. #ifdef OVERLAY
  88. #ifndef TRAMPOLI_H
  89. #include    "trampoli.h"
  90. #endif
  91.  
  92. #undef EXTERN_H
  93. #include    "extern.h"
  94. #endif /* OVERLAY */
  95.  
  96.  
  97. #ifdef STRONGHOLD
  98. # define Inhell        (dlevel > stronghold_level && dlevel <= MAXLEVEL)
  99. #else
  100. # define Inhell     (dlevel >= HELLLEVEL)
  101. #endif
  102.  
  103. #ifdef SPELLS
  104. #define    NO_SPELL    0
  105. #endif
  106.  
  107. /*** some utility macros ***/
  108. # ifndef STUPID_CPP    /* otherwise these macros are functions in hack.c */
  109. #define yn() yn_function(ynchars, 'n')
  110. #define ynq() yn_function(ynqchars, 'q')
  111. #define ynaq() yn_function(ynaqchars, 'y')
  112. #define nyaq() yn_function(nyaqchars, 'n')
  113.  
  114. #define max(a, b) ((a) > (b) ? (a) : (b))
  115. #define min(x,y) ((x) < (y) ? (x) : (y))
  116. #define    plur(x)    (((x) == 1) ? "" : "s")
  117.  
  118. #define    makeknown(x)    objects[x].oc_name_known = 1
  119. # endif /* STUPID_CPP */
  120.  
  121. #if defined(MSDOS) || defined(MACOS)
  122. #define getuid() 1
  123. #define getlogin() ((char *) NULL)
  124. #endif /* MSDOS */
  125.  
  126. /* Macro for a few items that are only static if we're not overlaid.... */
  127. #if defined(OVERLAY)
  128. # define STATIC_PTR
  129. #else
  130. # define STATIC_PTR static
  131. #endif
  132.  
  133. #if defined(OVERLAY) && (defined(OVL0) || defined(OVL1) || defined(OVL2) || defined(OVL3) || defined(OVLB))
  134. # define STATIC_DCL extern
  135. # define STATIC_OVL
  136. # ifdef OVLB
  137. #  define STATIC_VAR
  138. # else
  139. #  define STATIC_VAR extern
  140. # endif
  141. #else
  142. # define STATIC_DCL static
  143. # define STATIC_OVL static
  144. # define STATIC_VAR static
  145. #endif
  146.  
  147. /* Unless explicit control is being taken of what is linked where, */
  148. /* always compile everything */
  149. #if !defined(OVERLAY) || (!defined(OVL0) && !defined(OVL1) && !defined(OVL2) && !defined(OVL3) && !defined(OVLB))
  150. # define OVL0  /* Highest priority */
  151. # define OVL1
  152. # define OVL2
  153. # define OVL3  /* Lowest specified priority */
  154. # define OVLB  /* The base overlay segment */
  155. #endif
  156.  
  157. #endif /* HACK_H /**/
  158.